/*
 * Copyright 2008-2023 dexian.vip. All rights reserved.
 * Support: http://www.dexian.vip
 * License: http://www.dexian.vip/license
 */

package vip.dexian.admin.security.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.events.SessionExpiredEvent;

/**
 * Session 配置
 *
 * @author 挺好的 2023年06月05日 15:27
 */
@Configuration ("redisSessionConfig")
@EnableRedisHttpSession (maxInactiveIntervalInSeconds = 1800)
@Slf4j
public class RedisSessionConfig {

    
    /**
     * session 过期事件
     *
     * @param expiredEvent
     */
    @EventListener
    public void onSessionExpired (SessionExpiredEvent expiredEvent) {
        log.debug("session 过期了");
    }
}
